package com.newbingo.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.persistence.*;
import org.hibernate.annotations.CollectionOfElements;
import com.newbingo.domain.common.EntitySupport;
import com.newbingo.domain.common.Identity;
import org.hibernate.annotations.MapKeyManyToMany;
import javax.persistence.JoinTable;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
/**
 * 每期游戏实体
 * Period Entity
 * 
 */

@Entity
@Table(name = "PeriodGame")
public class PeriodGame extends EntitySupport<PeriodGame, Integer> implements Serializable {
	@Identity
	private Integer pgno;
	private Integer pgnum;
	private Date periodTime;
	private GameTable gameTable;
	private PeriodGameResult periodGameResult;
	private Integer isDraw;


	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "pgno")
	public Integer getPgno() {
		return pgno;
	}

	public void setPgno(Integer pgno) {
		this.pgno = pgno;
	}

	public Integer getPgnum() {
		return pgnum;
	}

	public void setPgnum(Integer pgnum) {
		this.pgnum = pgnum;
	}

	public Date getPeriodTime() {
		return periodTime;
	}

	public void setPeriodTime(Date periodTime) {
		this.periodTime = periodTime;
	}
	
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
	@JoinColumn(name="gtno")
	public GameTable getGameTable() {
		return gameTable;
	}
	
	public void setGameTable(GameTable gameTable) {
		this.gameTable = gameTable;
	}
	
	@Embedded
	public PeriodGameResult getPeriodGameResult() {
		return periodGameResult;
	}

	public void setPeriodGameResult(PeriodGameResult periodGameResult) {
		this.periodGameResult = periodGameResult;
	}

	public Integer getIsDraw() {
		return isDraw;
	}

	public void setIsDraw(Integer isDraw) {
		this.isDraw = isDraw;
	}

	
	
}
